package cn.zw.design.order.formal;

public class ChangeChannelTV implements Command {

	Tv tv;
	int channel=1;
	int previousChannel;
	public ChangeChannelTV(Tv tv,int channel) {
		this.tv = tv;
		previousChannel = this.channel;
		this.channel=channel; 
	}
	
	@Override
	public void execute() {
		tv.changeChannel(channel);
	}

	@Override
	public void undo() {
		tv.changeChannel(previousChannel);
	}
	

}
